$(".top-close").on("click", function () {
    $(".open-menu").removeClass("open-menu-active")
  })
$(".menu").on("click", function () {
    $(".open-menu").addClass("open-menu-active")
})

$(".cate-btn").on("click",function(){
  $(".cate-list").removeClass("cate-list-close")
})
$(".covers").on("click",function(){
  $(".cate-list").addClass("cate-list-close")
})


function py(){
  var chat = document.getElementById("wechat");
  chat.select();
  document.execCommand("Copy");
   var r = confirm("已复制好，是否打开微信")
   if (r){
      window.location.href = 'weixin://';
   }
   $(".wechat").css('display','none')
}
$(".infos-close").on('click',function(){
  $(".wechat").css('display','none')
})
function copy(){
  $(".wechat").css('display','block')
}


function getQueryVariable(variable) {

  var query = window.location.search.substring(1);

  var vars = query.split("&");

  for (var i = 0; i < vars.length; i++) {

    var pair = vars[i].split("=");

    if (pair[0] == variable) { return pair[1]; }

  }

  return (false);

}

function setCookie(name, value) {

  document.cookie = name + "=" + escape(value) + ";path=/"
}

function getCookie(objName) {
  let arrStr = document.cookie.split("; ");
  for (let i = 0; i < arrStr.length; i++) {
    let temp = arrStr[i].split("=");
    if (temp[0] === objName) {
      return decodeURI(temp[1]);
    }
  }
}

function GetRef(){
       
  var ref = document.referrer
   if(ref||getQueryVariable('ly')!=""){
      var pattern = /^https:\/\/www.so.com/  
      var pattern2 = /^https:\/\/www.baidu.com/  
      if (pattern2.test(ref)||getQueryVariable('ly')=='bd'){
          $("#info_phone").text('19928798664')
          $("#wechat").val('19928798664')
          $("#info_wx").attr('src','/images/wxkefu001.png');
          $("#info_img").attr('src','/images/kefu360.jpg');
          $(".my_phone").text("19928798664");
          $(".my_wx_img").attr("src",'/images/wxkefu001.png')
          $(".my_qq").text("3476707433");
          $(".my_qqs").attr("src",'//wpa.qq.com/msgrd?v=3&uin=3476707433&site=qq&menu=yes');
          $(".my_email").text('3476707433@qq.com');
          $(".my_email").attr('src',"mailto:3476707433@qq.com");
          $(".qq_img").attr("src","/images/bdqq.png")
          setCookie('so',false)
          
      }else if(pattern.test(ref)||getQueryVariable('ly')=='360'){
               console.log(getQueryVariable('ly'))
              $("#info_phone").text('19166251823')
              $("#wechat").val('19166251823')
              $("#info_wx").attr('src','/images/2023wx.jpg');
              $("#info_img").attr('src','/upimg/2021051911063850.jpg');
              $(".my_phone").text("19166251823");
              $(".my_wx_img").attr("src",'/images/2023wx.jpg')
              $(".my_qq").text("3628728973");
              $(".my_qqs").attr("href",'//wpa.qq.com/msgrd?v=3&uin=3628728973&site=qq&menu=yes');
              setCookie('so',true)
      }else{
          if(getCookie("so")=="true"){
             $("#info_phone").text('19166251823')
             $("#wechat").val('19166251823')
              $("#info_wx").attr('src','/images/2023wx.jpg');
              $("#info_img").attr('src','/upimg/2021051911063850.jpg');
              $(".my_phone").text("19166251823");
              $(".my_wx_img").attr("src",'/images/2023wx.jpg')
              $(".my_qq").text("3628728973");
              $(".my_qqs").attr("href",'//wpa.qq.com/msgrd?v=3&uin=3628728973&site=qq&menu=yes');
          }else{
              $("#info_phone").text('19928798664')
              $("#wechat").val('19928798664')
              $("#info_wx").attr('src','/images/wxkefu001.png');
              $("#info_img").attr('src','/images/kefu360.jpg');
              $(".my_phone").text("19928798664");
              $(".my_wx_img").attr("src",'/images/wxkefu001.png')
              $(".my_qq").text("3476707433");
              $(".my_qqs").attr("src",'//wpa.qq.com/msgrd?v=3&uin=3476707433&site=qq&menu=yes');
              $(".my_email").text('3476707433@qq.com');
              $(".my_email").attr('src',"mailto:3476707433@qq.com");
              $(".qq_img").attr("src","/images/bdqq.png")
          }
      }
  }else{
      $("#info_phone").text('19928798664')
      $("#info_wx").attr('src','/images/wxkefu001.png');
      $("#info_img").attr('src','/images/kefu360.jpg');
      $(".my_phone").text("19928798664");
      $(".my_wx_img").attr("src",'/images/wxkefu001.png')
      $(".my_qq").text("3476707433");
      $(".my_qqs").attr("href",'//wpa.qq.com/msgrd?v=3&uin=3476707433&site=qq&menu=yes');
      $(".my_email").text('3476707433@qq.com');
      $(".my_email").attr('href',"mailto:3476707433@qq.com");
      $(".qq_img").attr("src","/images/bdqq.png")
  }
  
}

GetRef()